//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "ACTION_JURNAL.h"
#include "DMJ.h"
#include "PERIOD_ACTION_J.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "cxClasses"
#pragma link "dxBar"
//#pragma link "dxBarExtItems"
#pragma link "cxBarEditItem"
#pragma link "cxImage"
#pragma link "cxControls"
#pragma link "cxCustomData"
#pragma link "cxData"
#pragma link "cxDataStorage"
#pragma link "cxDBData"
#pragma link "cxEdit"
#pragma link "cxFilter"
#pragma link "cxGraphics"
#pragma link "cxGrid"
#pragma link "cxGridCustomTableView"
#pragma link "cxGridCustomView"
#pragma link "cxGridDBTableView"
#pragma link "cxGridLevel"
#pragma link "cxGridTableView"
#pragma link "cxLookAndFeelPainters"
#pragma link "cxLookAndFeels"
#pragma link "cxStyles"
#pragma link "dxBarExtItems"
#pragma link "DBAccess"
#pragma link "IBC"
#pragma link "MemDS"
#pragma resource "*.dfm"
TfrACTION_JURNAL *frACTION_JURNAL;
//---------------------------------------------------------------------------
__fastcall TfrACTION_JURNAL::TfrACTION_JURNAL(TComponent* Owner)
	: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TfrACTION_JURNAL::ZAPOLNI(int STAT,String DAT_NATH)
{
String SQL;
if (STAT==1) {
SQL="and a.data_act=:DAT_NATH";
}
dsetACTION_JURNAL->SQL->Clear();
dsetACTION_JURNAL->SQL->Text=" select a.data_act, a.time_act, a.name_comp,"
" a.ip_comp, u.naim as N_USER, a.kod_user, a.naim_form, a.nom_abon, "
"(select K.naim_kod from klsfct k where k.kod=33 and k.kod_hc=a.kod_event) "
" as EVENT, a.kod_event,(select K.naim_kod from klsfct k where k.kod=34 "
" and k.kod_hc=a.status_tranz) as ST_TRANZ, a.status_tranz "
" from action_jurnal a, users u where a.kod_user=u.kod_op " +SQL;
dsetACTION_JURNAL->Close();
if (STAT==1) {
dsetACTION_JURNAL->ParamByName("DAT_NATH")->AsString=DAT_NATH;
}

dsetACTION_JURNAL->Open();
}
//----------------------------------------------------------------------------
void __fastcall TfrACTION_JURNAL::dxBarButton8Click(TObject *Sender)
{
frPERIOD_ACTION_J->ShowModal();	
}
//---------------------------------------------------------------------------

